package com.sharemarking.wa.platform.controller;

import com.sharemarking.wa.common.ResponseParams;
import com.sharemarking.wa.platform.service.OrderDispatchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dxy
 */
@RestController
@RequestMapping(value = "orderDispatch")
public class OrderDispatchController {
    @Autowired
    OrderDispatchService orderDispatchService;


    /**
     * 获取司机列表
     *
     * @return
     * @throws Exception
     */
    @RequestMapping("getDriverList")
    public ResponseParams<?> getDriverList() throws Exception {
        return orderDispatchService.getDriverList();
    }


    /**
     * 取消订单
     *
     * @return
     * @throws Exception
     */
    @RequestMapping("cancelOrder")
    public ResponseParams<?> cancelOrder() throws Exception {
        return orderDispatchService.cancelOrder();
    }


    /**
     * 接单并分配司机
     *
     * @return
     * @throws Exception
     */
    @RequestMapping("assignDriver")
    public ResponseParams<?> assignOrReplaceDriver() throws Exception {
        return orderDispatchService.assignDriver();
    }

    /**
     * 更换司机
     *
     * @return
     * @throws Exception
     */
    @RequestMapping("replaceDriver")
    public ResponseParams<?> replaceDriver() throws Exception {
        return orderDispatchService.replaceDriver();
    }



}
